package com.leyou.auth.inter.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 载荷对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "UserInfo", description = "用户信息")
public class UserInfo {

    @ApiModelProperty(value = "用户id", name = "id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @ApiModelProperty(value = "用户名", name = "username")
    private String username;

    @JsonIgnore //角色信息，不能返回给前端
    private String roles;

    @JsonIgnore //用户类型，不能返回给前端
    private Boolean isFlag;

    public UserInfo(Long id, String username, String roles) {
        this.id = id;
        this.username = username;
        this.roles = roles;
    }
}